import { passWordRegular, phoneRegular } from './constant';

/**
 *
 * @param val
 * @returns 返回校验 boolean
 * @description 校验密码
 */
export const isPass = (val: string): boolean => passWordRegular.test(val);
/**
 *
 * @param val
 * @returns 返回校验 boolean
 * @description 校验手机号
 */
export const isPhone = (val: string): boolean => phoneRegular.test(val);

/**
 * 是否数字
 * @param val
 */
export const isNumber = (val?: number | null) => typeof val === 'number';
